<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<html>
    <head>
        <title>Programmatic Security</title>
    </head>
    <body>

        <h1 align=center>
            Employee Records
        </h1>
        <table border=4 cellpadding=1 align=center>
        <%
            Connection con;

            Class.forName("com.mysql.jdbc.Driver");
            con = DriverManager.getConnection("jdbc:mysql://localhost:3306/clases", "root", "kiko2897");

            Statement state = con.createStatement();
            ResultSet rs = state.executeQuery("SELECT * FROM employee");

            while (rs.next()) {
        %>
        
            <tr>
                <td><%=rs.getString("empname")%></td>
                <td><%=rs.getString("empdesg")%></td>
            </tr>
            <%}%>
        </table><br/> 
    </body>
</html>
